<?php
namespace app\index\model;
use think\Model;
class share extends Model{
    //model的构造方法
    protected function initialize(){
        parent::initialize();
    }
    //获取最近5条新闻
    public function getRecentShare(){
        $res=$this->order('ShareID desc')->limit(5)->select();
        return $res;
    }

    //获取分页的新闻数据
    public function getRepoterPage(){
        $res=$this->order('ShareID desc')->paginate(15);
        return $res;
    }
} 